package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.ProductUnitService;
import com.atguigu.spzx.model.entity.product.ProductUnit;
import com.atguigu.spzx.model.vo.common.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/product/productUnit")

public class ProductUnitController {
    @Resource
    ProductUnitService productUnitService;
    @GetMapping("findAll")
    public Result<List<ProductUnit>> findAll(){
        //业务层业务方法上可以通过aop注解对方法进行扩展
        List<ProductUnit> productUnits = productUnitService.findAll();
        return Result.ok(productUnits);
    }
}
